package com.sikaryofficial.dataindicator.domain.mapping;

import com.sikaryofficial.dataindicator.domain.dto.resp.BrowseDataResponse;
import com.sikaryofficial.dataindicator.domain.entity.BrowseData;
import com.sikaryofficial.dataindicator.domain.eo.BrowseDataEO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface BrowseDataMapping {

    BrowseDataMapping INSTANCE = Mappers.getMapper(BrowseDataMapping.class);

    @Mapping(target = "rpTime",
            expression = "java( new java.util.Date( browseData.getRpTime()) )")
    BrowseDataResponse convertToResponse(BrowseData browseData);
    List<BrowseDataResponse> convertToResponseList(List<BrowseData> browseDatas);

    BrowseDataEO convertToEO(BrowseDataResponse browseDataResponse);
    List<BrowseDataEO> convertToEOList(List<BrowseDataResponse> browseDatas);
}
